'use client';

import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';

import type { ToolbarButtonProps } from './types';

const ToolbarButton = ({ onClick, icon: Icon, isActive }: ToolbarButtonProps) => {
  return (
    <Button
      variant="ghost"
      size="icon"
      onClick={onClick}
      className={cn(
        'text-sm h-7 min-w-7 flex items-center justify-center rounded-sm hover:bg-neutral-200/80',
        isActive && 'bg-neutral-200/80'
      )}
    >
      <Icon className="size-4" />
    </Button>
  );
};

export default ToolbarButton;
